<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./node_modules/vue/dist/vue.js"></script>
  <style>
  </style>
</head>

<body>
  <div id="app">
    <!-- <input type="text" @input="changeMsg" :value="msg"> -->
    <input type="text" v-model="msg">
    <p>{{msg}}</p>
  </div>

  <script>
    // v-model 语法糖
    // 原理就是绑定value值，通过input事件去改变数据
    const app = new Vue({
      el: "#app",
      data: {
        msg: "hello world"
      },
      methods: {
        // changeMsg(e) {
        //   this.msg = e.target.value
        // }
      }

    })
  </script>
</body>

</html>
